package com.share.shareplatform.shareuser.dao;


import com.share.shareplatform.pojo.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserDao {
    Long addOne(User user);
    Integer updateOne(User user);
    Integer updateBaseOne(User user);
    Integer deleteOneById(Long id);
    Integer deleteAllByIds(Long[] ids);
    User findOneByUsername(String username);
    User findOneById(Long id);
    List<User> findPage(@Param("start")Integer start, @Param("pageSize")Integer pageSize);//分页查询
    User findOneSafeById(Long id);
    User findUserByUsernameAndPassword(User user);
    List<User> findAllByIds(Long[] ids);
    User findForeignOneByUsername(String username);
    List<User> findAllSafeByIds(Long[] ids);

    @MapKey("id")
    Map<Long,User> findAllSafeByIdsAsMap(List<Long> list);
}
